﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <%--// Author: Otto Neff | webapps-in-action.com--%>
    <title>webapps-in-action.com</title>
    <telerik:RadStyleSheetManager ID="radStyleSheetManager" runat="server" />
    <style type="text/css">
        .acResults {
            width: 100%;
            border-spacing: 0px;
            border-collapse: collapse;
        }

            .acResults td {
                vertical-align: middle;
            }

        .smallResultText {
            color: #666;
            font-size: 11px;
        }
    </style>
</head>
<body>
    <form id="form" runat="server">
        <telerik:RadScriptManager ID="radScriptManager" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <telerik:RadScriptBlock ID="radScriptBlock" runat="server">
            <script type="text/javascript">
                var autoComplete = {
                    Requesting: function (sender, eventArgs) {
                        var context = eventArgs.get_context();
                        context["CustomParameter"] = $find('<%=customText.ClientID%>').get_value();
                    }
                };
            </script>
        </telerik:RadScriptBlock>
        <telerik:RadAjaxManager ID="radAjaxManager" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadAutoCompleteBox runat="server" ID="radAutoComplete" EmptyMessage="Search"
            InputType="Token" Width="400" DropDownPosition="Automatic" DropDownWidth="550" OnClientRequesting="autoComplete.Requesting">
            <WebServiceSettings Method="search" Path="~/api/data/" />
            <ClientDropDownItemTemplate> 
                <table class="acResults" ><tr><td width="210"><img src="#= Attributes.LOGO_URL #" alt=""/></td><td>#= Attributes.RESULT_HTML #</td></tr></table>
            </ClientDropDownItemTemplate>
        </telerik:RadAutoCompleteBox>
        <telerik:RadTextBox runat="server" ID="customText" Text="I'm custom but not highlighted"></telerik:RadTextBox>
    </form>
</body>
</html>










